import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
//toolDistMeasure 距离测量菜单
Item
{
    id:toolDistMeasureSub
    width:toolDistMeasureSubBg.width
    height:toolDistMeasureSubBg.height
    transform: Scale { origin.x: 0; origin.y: 0; xScale: root.x_enl-0.3;yScale: root.y_enl-0.3}
    z:1

    Image
    {
        id:toolDistMeasureSubBg
        source:"./切图/工具箱/距离测量/测量底子.png"
        MouseArea{id:toolDistMeasureSubBgArea;anchors.fill:parent}
    }
    Image
    {
        id:toolDistMeasureSubClose
        source:"./切图/排行/关闭.png"
        //            height: 170
        anchors.top:toolDistMeasureSubBg.top
        anchors.right: toolDistMeasureSubBg.right
        anchors.topMargin: 12
        anchors.rightMargin: 10
        MouseArea{id:toolDistMeasureSubCloseArea;anchors.fill:parent
            onClicked:
            {
                toolDistMeasureSub.visible = false
                earthView.slotMeasure(-1)
            }
        }
    }
    Text
    {
        id:measurementResultText
        anchors.top: toolDistMeasureSubBg.top
        anchors.topMargin: 54
        anchors.left: toolDistMeasureSubBg.left
        anchors.leftMargin: 20
        text:"测量结果 :"
        font.pixelSize: 15
        color: "white"
        font.family: "微软雅黑"

    }
    Text
    {
        id:measurementResult
        anchors.top: toolDistMeasureSubBg.top
        anchors.topMargin: 54
        anchors.left: measurementResultText.right
        anchors.leftMargin:5
        text:" ----- km"
        font.pixelSize: 15
        color: "white"
        font.family: "微软雅黑"

    }
    Row
    {
        anchors.left: toolDistMeasureSubBg.left
        anchors.leftMargin: 32
        anchors.bottom: toolDistMeasureSubBg.bottom
        anchors.bottomMargin: 14
        spacing: 50
        Image
        {
            id:calculation
            source:calculationArea.containsPress ? "./切图/工具箱/距离测量/计算点击.png" :"./切图/工具箱/距离测量/计算.png"
            //            height: 170
            MouseArea{id:calculationArea;anchors.fill:parent
                onClicked:
                {
//                    //距离调用
                    var z = Math.floor(parseFloat(earthView.slotGetMeasureResult()) *1000)/1000
                    measurementResult.text =   " " + z + " km"
                }
            }
        }

        Image
        {
            id:eliminate
            source:eliminateArea.containsPress ? "./切图/工具箱/距离测量/清除点击.png" :"./切图/工具箱/距离测量/清除.png"
            //            height: 170

            MouseArea{id:eliminateArea;anchors.fill:parent
                onClicked:
                {
                    earthView.slotClearMeasureResult()
                    measurementResult.text = " ----- km"
                }
            }
        }

    }

}

